package com.cgw.game.ui;

import android.graphics.Color;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;

import com.cgw.game.R;
import com.cgw.game.entity.RoseEntity;
import com.cgw.game.view.RoseChartView2;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by LhfBoy on 2019/5/22 0022 14:49.
 */
public class RoseLeafViewActivity extends AppCompatActivity {

    RoseChartView2 roseChartView2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.a_roseleaf);
        roseChartView2 = findViewById(R.id.rose_chartView2);
        initData();
    }

    public void initData() {
        ArrayList<RoseEntity> listRoseLeafs = new ArrayList<>();
        listRoseLeafs.add(new RoseEntity("面粉", 0.19f, 0.33f, R.color.red));
        listRoseLeafs.add(new RoseEntity("白砂糖白砂糖", 0.21f, 0.27f, R.color.yellow));
        listRoseLeafs.add(new RoseEntity("胡椒粉", 0.18f, 0.20f,R.color.green));
        listRoseLeafs.add(new RoseEntity("果仁2", 0.28f, 0.13f, R.color.sleep_out_point_bg));
        listRoseLeafs.add(new RoseEntity("果", 0.14f, 0.07f, R.color.blue_21));

        roseChartView2.setDataRoseLeaf(listRoseLeafs);
        roseChartView2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                roseChartView2.executeAnim();
            }
        });

    }
}
